package com.xhsj.user.sms.purchase.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Lists;
import com.xhsj.user.sms.base.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 采购任务表
 * </p>
 *
 * @author suxiaolin
 * @since 2020-05-25
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("tb_purchase_task")
public class TbPurchaseTask extends BaseEntity<TbPurchaseTask> {

    private static final long serialVersionUID = 1L;

    /**
     * 采购编号
     */
    @TableField("purchase_number")
    private String purchaseNumber;

    /**
     * 经办人
     */
    @TableField("agent")
    private String agent;

    /**
     * 部门id
     */
    @TableField("dept_id")
    private Integer deptId;
    /**
     * 部门名称
     */
    @TableField(exist = false)
    private String deptName;

    /**
     * 提交状态 1 保存 2 提交
     */
    @TableField("submit_status")
    private Integer submitStatus;

    /**
     * 归口部门id
     */
    @TableField("relevant_dept_id")
    private Integer relevantDeptId;

    /**
     * 归属项目
     */
    @TableField("belong_project")
    private String belongProject;

    /**
     * 采购类别
     */
    @TableField("category")
    private String category;

    /**
     * 期望到货时间
     */
    @TableField("arrival_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date arrivalTime;

    /**
     * 节点名称
     */
    @TableField("node_name")
    private String nodeName;

    /**
     * 总金额
     */
    @TableField("total_money")
    private BigDecimal totalMoney;
    /**
     * 所属角色
     */
    @TableField("belong_role")
    private String belongRole;

    /**
     * 任务来源 0 采购申请 1 直接任务
     */
    @TableField("task_source")
    private String taskSource;

    /**
     * 预算范围 0预算内  1预算外
     */
    @TableField("budget_range")
    private String budgetRange;

    /**
     * 用途及试用阶段
     */
    @TableField("use_and_trial_phase")
    private String useAndTrialPhase;

    /**
     * 请购意向或方案
     */
    @TableField("intention_or_scheme")
    private String intentionOrScheme;
    /**
     * 指派用户名称
     */
    @TableField("assign_user_name")
    private String assignUserName;
    /**
     * 审核状态
     */
    @TableField("audit_status")
    private String auditStatus;
    /**
     * 审核状态
     */
    @TableField("deal_with_status")
    private String dealWithStatus;

    /**
     * 请购意向活方案文件
     */
    @TableField(exist = false)
    private List<TbPurchaseTaskFile> tbPurchaseApplyFileList;

    /**
     * 任务清单
     */
    @TableField(exist = false)
    private List<TbPurchaseTaskList> tbPurchaseApplyList;

    @TableField(exist = false)
    private List<String> purchaseUsers = Lists.newArrayList();

    /*以下字段用于查询任务转出使用*/

    @TableField(exist = false)
    private List<Object> userList = Lists.newArrayList();


}
